const rule = require("../rule");
const CardBox = require("../CardBox");
const Card = require("../Card");
const CardList = Card.CardList;
const Player = require("../Player");
const CARDBOX = new CardBox();
const tester = new Player("test1");

// var card_list = "梅花_1,方块_2,梅花_2,方块_4,梅花_5,黑桃_2,黑桃_7,红心_7,方块_9,黑桃_10,方块_J,黑桃_Q,黑桃_K".split(",").map(txt => Card.getIns(txt));
// var res_info = {};
// // console.log(rule.is_two_pair(card_list, res_info));
// // console.log(JSON.stringify(res_info));
// console.log(JSON.stringify(
// 	rule.check_two_pair(card_list)
// ));

// var card_list = "方块_2,梅花_2,黑桃_7,红心_7,方块_9".split(",").map(txt => Card.getIns(txt));
// var res_info = {};
// // console.log(rule.is_two_pair(card_list, res_info));
// // console.log(JSON.stringify(res_info));
// console.log(JSON.stringify(
// 	rule.is_two_pair(card_list,res_info)
// ),res_info);
// var card_list = "方块_2,梅花_2,黑桃_7,红心_7,方块_10".split(",").map(txt => Card.getIns(txt));
// var res_info = {};
// // console.log(rule.is_two_pair(card_list, res_info));
// // console.log(JSON.stringify(res_info));
// console.log(JSON.stringify(
// 	rule.is_two_pair(card_list,res_info)
// ),res_info);

// var card_list = "梅花_1,梅花_2,梅花_3,梅花_4,梅花_5,方块_6,方块_7,方块_8,方块_9,方块_10,方块_J,方块_Q,方块_K".split(",").map(txt => Card.getIns(txt));

// console.log(
// 	rule.check_straight_flush(card_list).map(CardList.sort_cards).join("\n")
// );

// var card_list_1 = "梅花_2,红心_3,方块_4,红心_K,方块_K"
// 	.split(",")
// 	.map(txt => Card.getIns(txt));
// var res_1 = {};
// rule.is_two(card_list_1, res_1);
// console.log(res_1);

// var card_list_2 = "梅花_1,梅花_6,方块_7,黑桃_Q,方块_Q"
// 	.split(",")
// 	.map(txt => Card.getIns(txt));
// var res_2 = {};
// rule.is_two(card_list_2, res_2);
// console.log(res_2);

var card_list = "梅花_1,梅花_2,黑桃_3,梅花_4,梅花_5,黑桃_6,方块_7,黑桃_8,方块_1,方块_4,方块_3,方块_8,黑桃_3".split(",").map(txt => Card.getIns(txt));

console.log(
	rule.is_all_small(card_list)
);